//import java.util.Arrays;
//import java.util.Scanner;
//
////import java.util.Scanner;
////
////public class Main {
////    public static void main(String[] args) {
////        Scanner sc=new Scanner(System.in);
////        while(sc.hasNextLine()){
////            String line=sc.nextLine();
////            String[] parts=line.split(" ");
////            Shape shape=null;
////            if(parts.length==1){
////                double r=Double.parseDouble(parts[0]);
////                shape=new Circle(r);
////            }else if(parts.length==2){
////                double len=Double.parseDouble(parts[0]);
////                double wid=Double.parseDouble(parts[1]);
////                shape=new Rectangle(len,wid);
////            }else if (parts.length == 3) {
////                double a = Double.parseDouble(parts[0]);
////                double b = Double.parseDouble(parts[1]);
////                double c = Double.parseDouble(parts[2]);
////                shape = new Triangle(a, b, c);
////            }
////            System.out.printf("%.2f\n", shape.length());
////        }
////    }
////}
////
////class Triangle implements Shape{
////    private double a,b,c;
////
////    public Triangle(double a, double b, double c) {
////        this.a = a;
////        this.b = b;
////        this.c = c;
////    }
////    public boolean isValid(){
////        if(a>0&&b>0&&c>0&&(a+b>c)&&(a+c>b)&&(b+c>a)){
////            return true;
////        }
////        return false;
////    }
////    @Override
////    public double length() {
////        if(isValid()){
////            return a+b+c;
////        }
////        return 0;
////    }
////}
////class Rectangle implements Shape{
////    private double a,b;
////
////    public Rectangle(double a, double b) {
////        this.a = a;
////        this.b = b;
////    }
////    public boolean isValid(){
////        if(a>0&&b>0){
////            return true;
////        }
////        return false;
////    }
////    @Override
////    public double length() {
////        if(isValid()){
////            return 2*(a+b);
////        }
////        return 0;
////    }
////}
////class Circle implements Shape{
////    private double radius;
////
////    public Circle(double radius) {
////        this.radius = radius;
////    }
////    public boolean isValid(){
////        if(radius>0){
////            return true;
////        }
////        return false;
////    }
////    @Override
////    public double length() {
////        if(isValid()){
////            return 3.14*2*radius;
////        }
////        return 0;
////    }
////
//public class Main{
//    public static double sumAllArea(Shape[] shape){
//        double sum=0;
//        for(Shape s:shape){
//            sum+=s.getArea();
//        }
//        return sum;
//    }
//    public static double sumAllPerimeter(Shape[] shape){
//        double sum=0;
//        for(Shape s:shape){
//            sum+=s.getPerimeter();
//        }
//        return sum;
//    }
//    public static void main(String[] args) {
//        Scanner sc=new Scanner(System.in);
//        int n=sc.nextInt();
//        Shape[] shape=new Shape[n];
//        for(int i=0;i<n;i++){
//            String type=sc.next();
//            if(type.equals("rect")){
//                int wid=sc.nextInt();
//                int len=sc.nextInt();
//                shape[i]=new Rectangle(wid,len);
//            }else if(type.equals("cir")){
//                int r=sc.nextInt();
//                shape[i]=new Circle(r);
//            }
//        }
//        System.out.printf("%.2f\n",sumAllPerimeter(shape));
//        System.out.println(sumAllArea(shape));
//        System.out.println(Arrays.toString(shape));
//        for(Shape s:shape){
//            System.out.println("class "+s.getClass().getName() +
//                    "," + "class "+s.getClass().getSuperclass().getName());
//        }
//    }
//
//}
//abstract class Shape {
//    public static final double PI = 3.14;  // 静态常量
//
//    public abstract double getPerimeter();  // 周长
//    public abstract double getArea();       // 面积
//}
//class Rectangle extends Shape{
//    private int a,b;
//
//    public Rectangle(int a, int b) {
//        this.a = a;
//        this.b = b;
//    }
//    public boolean isValid(){
//        if(a>0&&b>0){
//            return true;
//        }
//        return false;
//    }
//    @Override
//    public double getPerimeter() {
//        if(isValid()){
//            return 2*(a+b);
//        }
//        return 0;
//    }
//    public  double getArea(){
//        if(isValid()) {
//            return a * b;
//        }
//        return 0;
//    }
//    public String toString(){
//        return "Rectangle [width="+a+", length="+b+"]";
//    }
//}
//class Circle extends Shape{
//    private int radius;
//
//    public Circle(int radius) {
//        this.radius = radius;
//    }
//    public boolean isValid(){
//        if(radius>0){
//            return true;
//        }
//        return false;
//    }
//    @Override
//    public double getPerimeter() {
//        if(isValid()){
//            return PI*2*radius;
//        }
//        return 0;
//    }
//    public double getArea(){
//        if(isValid()) {
//            return PI * radius * radius;
//        }
//        return 0;
//    }
//    public String toString(){
//        return "Circle [radius="+radius+"]";
//    }
//}
//

